<ul class="maintabmenu multipletabmenu">
    <li><a href="<?php echo base_url(); ?>administrator/projects">Tất cả dự án</a></li>
    <li class="current"><a href="<?php echo base_url(); ?>administrator/projects/create">Thêm mới dự án</a></li>
    <li><a href="<?php echo base_url(); ?>administrator/pcategories">Danh mục dự án</a></li>
</ul>
<div class="content">
    <form action="" method="post" accept-charset="utf-8" id="projects-form" class="stdform">
        <div class="edit-main">    
            <?php
            if ($this->session->flashdata('insert_projects_success')) {
                ?>
                <div class="notification msgsuccess">
                    <a class="close"></a>
                    <p>Thêm dự án thành công.</p>
                </div>
            <?php } else if ($this->session->flashdata('insert_projects_error')) { ?>
                <div class="notification msgerror">
                    <a class="close"></a>
                    <p>Đã xảy ra lỗi.</p>
                </div>
            <?php } ?>
            <p><label>Tiêu đề:</label></p>
            <p><span class="field"><input class="longinput" name="title" type="text"></span></p>
            <br>                            
            <p><label>Tóm tắt:</label></p>                            
            <p><span class="field"><textarea name="description"></textarea></span></p>
            <br>
            <p><label>Nội dung:</label></p>                            
            <p class="editor"><textarea name="content" id="editor_content"></textarea>
                <br>
        </div>
        <div class="edit-right">            
            <div class="widgetbox">
                <div class="title"><h2 class="general"><span>Xuất bản</span></h2></div>
                <div class="widgetcontent" style="display: block;">                                           
                    <br>
                    <p class="stdformbutton" style="margin-left: 0px;">
                        <button class="submit radius2">Xuất bản</button>
                        <input value="Hủy" class="reset radius2" type="reset">
                    </p>
                </div><!--widgetcontent-->
            </div>
            <div class="widgetbox">
                <div class="title"><h2 class="general"><span>Danh mục dự án</span></h2></div>
                <div class="widgetcontent" style="display: block;">

                    <span class="formwrapper form-no-margin">
                        <?php 
                        $i=0;
                        foreach ($categories as $cat) { ?>
                            <input type="radio" name="projects_cat" <?php if($i==0) echo 'checked="checked"';?> value="<?php echo $cat->id; ?>" id="projects_cat_<?php echo $cat->id; ?>"/> <label for="projects_cat_<?php echo $cat->id; ?>"> <?php echo $cat->name; ?></label><br>
                        <?php $i++; } ?>                       
                    </span>                                  

                </div>
            </div>
            <div class="widgetbox">
                <div class="title"><h2 class="general"><span>Ảnh đại diện</span></h2></div>
                <div class="widgetcontent" style="display: block;">
                    <input id="featured_image" name="hdffeatured_image" type="hidden">
                    <img src="" id="featured_image_src" style="margin-bottom:10px;" height="auto" width="100%">
                    <button id="imageUpload" class="submit radius2">Chọn ảnh đại diện</button>
                </div>
            </div>
        </div>
    </form>    
   
</div>

<script>
    window.onload = function() {
        CKEDITOR.replace('content', {
            toolbar: 'standard',
            filebrowserBrowseUrl: '<?php echo base_url(); ?>elfinder/elfinder.html'
        });
    };
</script>